<template>
	<view>
			<!-- <u--image :src="info.headimgurl" width="45px" height="45px"/> -->
		<view class="item_content bg-white layout-margin-16" @click="getDetails">
			<view class="Media Media--center" style="margin-bottom: 12px;">
				<u-tag v-if="objInfo.tag=='足球'" class="tag" :text="objInfo.tag" mode="light" size="mini" bgColor="#EDF8F1" color="#52B36D" />
				<u-tag v-else class="tag" :text="objInfo.tag" mode="light" size="mini" bgColor="#EDF8FF" color="#3EA5E9"  />
				<view class="Media-body" style=" font-weight: 600; font-size: 16px; color: #333333; padding: 0 10px;">{{objInfo.title}}</view>
			</view>
			<view class="item-info" v-for="(i,o) in objInfo.list" :key="o">
				<view>{{i.name}}</view>
				<view v-if="!isString(i.value)">
					<image style="width:22px;height:22px;border-radius: 100px;border: 1px solid #8e8a8a;margin-right: 4px;" :src="i.value.image" mode=""></image>
					<view>{{i.value.name}}</view>
				</view>
				<view v-if="isString(i.value)" :class="i.type=='orange'?'orange-color':i.type=='black'?'black-color':''">{{i.value}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'item',
		data () {
			return {
				objInfo: {}
			}
		},
		props: {
			info: {
				type: Object,
				default: () => ({})
			}
		},
		computed: {

		},
		methods: {
			isString(value) {
				return typeof value === 'string'
			},
			// 跳转详情
			getDetails () {
				uni.navigateTo({
					url: `/pages/details/details?content_id=${this.info.content_id}&currentIndex=0&appid=${this.info.app_id}`
				})
			}
		},
		mounted () {
			this.objInfo = {
				tag: this.info.category_id==3?'足球':'篮球',
				title: this.info.title,
				list: [
					{name: '收入', value: `+￥${this.info.pay_real}`, type: 'orange'},
					{name: '来源', value: this.info.wechat_info.title, type: 'black'},
		
					{name: '客户', value: {
							image: this.info.headimgurl,
							name: this.info.nickname
						}
					},
					{name: '购买时间', value: this.info.pay_time},
				]
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import "@/assets/css/user.scss";
</style>